<?php

namespace xuesi\swoole\pool\simple\pool;

use summer\swoole\pool\contract\ConnectionInterface;
use summer\swoole\pool\Pool as AbstractPool;

class Pool extends AbstractPool
{
    protected $callback;

    public function __construct(callable $callback, array $option)
    {
        $this->callback = $callback;

        parent::__construct($option);
    }

    protected function createConnection(): ConnectionInterface
    {
        return new Connection($this, $this->callback);
    }
}